package com.config;

import com.alibaba.fastjson.JSON;
import com.model.response.Request;

import javax.websocket.Decoder;
import javax.websocket.EndpointConfig;

public class WebSocketDecoder implements Decoder.Text<Request> {
    @Override
    public Request decode(String json){
        return JSON.parseObject(json, Request.class);
    }

    @Override
    public boolean willDecode(String s) {
        return true;
    }

    @Override
    public void init(EndpointConfig endpointConfig) {

    }

    @Override
    public void destroy() {

    }
}
